

#include <REG51.H>
#include <key.h>




sbit LED1=P2^0;	//?P2.0?????LED1
sbit LED2=P2^1;	//?P2.0?????LED1
sbit LED3=P2^2;	//?P2.0?????LED1

sbit LED4=P2^3;	//?P2.0?????LED1
sbit LED5=P2^4;	//?P2.0?????LED1
sbit LED6=P2^5;	//?P2.0?????LED1


 





void main()	
{

  u8 i = 0 ;
	while(1)
	{
	
	   u8 keyVal = 	key_scan();
	
		
			if(keyVal == 1)
			{
				LED1=!LED1;			
			}				
		  else 	if(keyVal == 2)
			{
				LED2=!LED2;			
			}			
			 else 	if(keyVal == 3)
			{
				for( i = 0 ; i < 50; i++)
				{							
					LED3=!LED3;	
					delay_10us(5);					
				}

				
			}			
			 else 	if(keyVal == 4)
			{
				LED4=!LED4;			
			}			
			 else 	if(keyVal == 5)
			{
				LED5=!LED5;	 		
			}			
			 else 	if(keyVal == 6)
			{
				LED6=!LED6;			
			}			
		
		
	
	}






}